# coding: utf-8

import os

a = [0,1,0,1,0,1,1,0,1,1,0,0,1,0,1,0,1,0,1,0]
string = ''
column = 4
start_i = 0
stop_i = column
while True:
    for i in range(start_i, stop_i):
        string += '{0} '.format(a[i])
    string += os.linesep
    start_i = stop_i
    stop_i += column
    if stop_i >= len(a):
        break
print(string)


import base64

with open("train/source/0c9bfd51-dc8f-45ad-bf3b-ae0de2610ed7.jpg", "rb") as f:
    # b64encode是编码，b64decode是解码
    base64_data = base64.b64encode(f.read())
    print(base64.b64decode(base64_data))
    print(base64_data)

